import { AxiosPromise } from "axios";
import { LogQuery, LogPageResult, LogPageVO } from "./types";
import service from "@/utils/request";
const { systemService } = service;

/**
 * 获取登录日志分页数据
 *
 * @param queryParams
 */
export function loginLogApi(
  queryParams: LogQuery,
  searchObj: any
): AxiosPromise<LogPageResult> {
  const { page, limit } = queryParams;
  return systemService({
    url: `/system/sysLoginLog/${page}/${limit}`,
    method: "get",
    params: searchObj,
  });
}

/**
 * 获取操作日志分页数据
 *
 * @param queryParams
 */
export function operLogApi(
  queryParams: LogQuery,
  searchObj: any
): AxiosPromise<LogPageResult> {
  const { page, limit } = queryParams;
  return systemService({
    url: `/system/sysOperLog/${page}/${limit}`,
    method: "get",
    params: searchObj,
  });
}
